﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Apworks;

namespace TinyForum.Domain.Model
{
    public class Setting : AggregateRoot
    {
        private string siteTitle;
        private string siteDescription;
        private string siteCopyright;
        private string siteTheme;
        private int? postsPerPage;
        private int? repliesPerPage;

        public Setting()
        {
        
        }

        public virtual string SiteTitle
        {
            get { return this.siteTitle ?? @"Tiny Forum"; }
            set { this.siteTitle = value; }
        }

        public virtual string SiteDescription
        {
            get { return this.siteDescription ?? @""; }
            set { this.siteDescription = value; }
        }

        public virtual string SiteCopyright
        {
            get { return this.siteCopyright ?? @"Copyright (C) 2011-2012, YourCompany.com, all rights reserved."; }
            set { this.siteCopyright = value; }
        }

        public virtual string SiteTheme
        {
            get { return this.siteTheme ?? "Default"; }
            set { this.siteTheme = value; }
        }

        public virtual int? PostsPerPage
        {
            get { return this.postsPerPage ?? 25; }
            set { this.postsPerPage = value; }
        }

        public virtual int? RepliesPerPage
        {
            get { return this.repliesPerPage ?? 25; }
            set { this.repliesPerPage = value; }
        }

        public static Setting Default
        {
            get
            {
                return new Setting
                {
                    PostsPerPage = 25,
                    RepliesPerPage = 25,
                    SiteCopyright = @"Copyright (C) 2011-2012, YourCompany.com, all rights reserved.",
                    SiteDescription = @"",
                    SiteTheme = "Default",
                    SiteTitle = "Tiny Forum"
                };
            }
        }
    }
}
